import { OUT_PUT_ENUM, TRIGGER_EVENT_ENUM } from '@CONSTANTS/smartAssistant'
import { TagDetailITF } from '@INTERFACES/Tag'
import { EventsITF } from '@INTERFACES/Events'
import { FeedITF } from '@INTERFACES/Feed'
import { DoctorITF } from '@INTERFACES/Doctor'
import { CourseITF } from '@INTERFACES/Video'
import { ChoiceITF, EvaluationITF, EvaluationResultITF, QuestionITF, SurveyITF } from '@INTERFACES/Survey'
import { PlanManagementITF } from '@INTERFACES/PlanManagement'
import { ConsultationITF } from '@INTERFACES/Consultation'

export interface AdditionalChoiceITF {
  TriggerEvent: TRIGGER_EVENT_ENUM;
  Label: string
}

export interface SelfEvalDataITF {
  Caption: string;
  Label: string;
  Flows?: EvaluationITF[];
  Templates?: EvaluationITF[];
}

export interface SelfEvalITF {
  DecisionFlowData: SelfEvalDataITF;
  SurveyTemplatesData: SelfEvalDataITF;
  OpEventData: { OpEvents: EventsITF[]; Caption: string };
}

export interface SearchResultITF {
  FeedItem: { FeedItems: FeedITF[] };
  Doctor: { Doctors: DoctorITF[] };
  Course: { Courses: CourseITF[] };
  Tag: { Tags: TagDetailITF[] };
}

export interface EvaluationChoiceITF extends QuestionITF {
  p8Id: string;
  uuId: string;
  isEdit: boolean;
  showChoice: boolean;
  AnswerChoice: ChoiceITF;
}

export interface PainManagementDataITF {
  CurrentDay: number;
  Duration: number;
  PainManagement: PlanManagementITF
}

export interface ConsultationDataITF {
  Total: number;
  Consultations: ConsultationITF[]
}
export interface ManagementTemplateDataITF {
  Total: number;
  Templates: PlanManagementITF[]
}

export interface AssistantMsgITF {
  id: string;
  uuId?: string;
  isSelf: boolean;
  Code: string;
  JourneyId: string;
  AllowEnterText: boolean;
  TriggerEvent: TRIGGER_EVENT_ENUM;
  PreNote: string;
  PostNote: string;
  MainNote: string;
  Text: string;
  EntityId: string;
  SearchText: string;
  OutputType: OUT_PUT_ENUM;
  AdditionalChoices: AdditionalChoiceITF[];
  Data: EventsITF[] | TagDetailITF | SearchResultITF | SurveyITF |
        SelfEvalITF | PainManagementDataITF | FeedITF | ConsultationDataITF | ManagementTemplateDataITF;
  EvaluationChoice?: EvaluationChoiceITF;
  EvaluationAnswer: EvaluationChoiceITF;
  EvaluationResult: EvaluationResultITF;
}

export interface SmartAssistantExtraData {
  triggerEvent?: TRIGGER_EVENT_ENUM;
  title: string;
  eventId: string;
  isContact?: boolean;
}
